<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:rich="http://richfaces.org/rich"
	template="layout/template.xhtml">

	<ui:define name="body">

		<div id="banner">
			<h1>#{messages['application.title']}</h1>
			<h2>...#{messages['application.tagline']}</h2>
			<s:fragment rendered="#{not identity.loggedIn}">
				<p>#{messages['membership.notMember']}#{' '}<s:link id="register" value="#{messages['membership.signUp']}" view="/register.xhtml" /> or #{' '}<s:link id="learn" value="learn more" view="/about-flyer.xhtml"/> about the site.</p>
			</s:fragment>
		</div>

		<h:messages globalOnly="true" styleClass="message" errorClass="errormsg" infoClass="infomsg" warnClass="warnmsg"/>
    
		<h:panelGrid columns="2" styleClass="panel-layout" columnClasses="panel-column,panel-column">
			<rich:panel styleClass="main-panel">
				<f:facet name="header">About #{messages['application.title']}</f:facet>
				<p>Open 18 is a golf course directory and community site for golf players.</p>
				<p><strong>Golf course directory:</strong></p>
				<p>The golf course directory allows you to browse for golf facilities/courses or search for one in your area. The information available includes the facility, the course, the holes, the tee sets and the tees.</p>
				<p><strong>The clubhouse:</strong></p>
				<p>The clubhouse is a social utility that allows you to connect with other golfers. When you register to become a golfer, you will get a profile, which you can share with others. Along with that profile, you can track your golf rounds and publish personal experiences.</p>
				<p></p>
				<p>
					<s:link action="#{reportGenerator.generate}" value="Generate sample report"/>
					#{' | '}
					<s:link view="/sampleReport.xhtml" value="Render sample report"/>
				</p>
			</rich:panel>
			<h:panelGroup>
				<rich:panel styleClass="module-box">
					<f:facet name="header">Cool New Golfers</f:facet>
	
					<s:div rendered="#{empty newGolfers || newGolfers.size == 0}">
						It's really quite around here!
					</s:div>

					<h:form id="selectGolfer">
						<rich:dataList var="_golfer" value="#{newGolfers}">
							<h:commandLink action="#{profileAction.view}" value="#{_golfer.name} (#{_golfer.username})"/>
						</rich:dataList>
					</h:form>
				</rich:panel>
				<rich:panel styleClass="module-box" rendered="#{s:hasRole('golfer')}">
					<f:facet name="header">Favorite Facilities</f:facet>
					<s:div rendered="#{favoriteFacilities.size == 0}">
						You haven't selected any favorite facilities.
					</s:div>
					<rich:dataList var="_facility" value="#{favoriteFacilities}">
						<s:link id="viewFacility" view="/Facility.xhtml" value="#{_facility.name}" propagation="none">
							<f:param name="facilityId" value="#{_facility.id}"/>
						</s:link>
					</rich:dataList>
				</rich:panel>
				<rich:panel styleClass="module-box" rendered="#{not empty conversationList}">
					<f:facet name="header">Workspaces</f:facet>
					<h:form id="switcher">
						<div style="text-align: center;">
							<h:selectOneMenu value="#{switcher.conversationIdOrOutcome}">
								<f:selectItems value="#{switcher.selectItems}"/>
							</h:selectOneMenu>
						</div>
						<div style="text-align: center;">
							<h:commandButton action="#{switcher.select}" value="Switch workspace"/>
						</div>
					</h:form>
				</rich:panel>
			</h:panelGroup>
		</h:panelGrid>
    
	</ui:define> 
</ui:composition>
